var t = require("../../utils/config.js");

Page({
    data: {
        content: "",
        mobile: ""
    },
    onLoad: function(t) {},
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getContent: function(t) {
        this.setData({
            content: t.detail.value
        });
    },
    getMobile: function(t) {
        this.setData({
            mobile: t.detail.value
        });
    },
    apply: function() {
        var n = this;
        if (n.data.content) if (n.data.mobile) {
            wx.showLoading({
                mask: !0
            });
            var o = {
                userId: wx.getStorageSync("userId"),
                content: n.data.content,
                mobile: n.data.mobile
            };
            wx.request({
                url: t.urlList.API_FEED_BACK_APPLY,
                method: "POST",
                header: {
                    contentType: "application/json"
                },
                data: o,
                success: function(t) {
                    wx.hideLoading(), 200 == t.data.status ? (wx.navigateBack(), wx.showToast({
                        title: "提交成功"
                    })) : wx.showToast({
                        title: t.data.message,
                        icon: "none"
                    });
                }
            });
        } else wx.showToast({
            title: "请输入联系方式",
            icon: "none"
        }); else wx.showToast({
            title: "请输入宝贵意见",
            icon: "none"
        });
    }
});